<?php
/**
 * Created by PhpStorm.
 * User: ysk
 * Date: 2021/6/21
 * Time: 14:42
 */

namespace api\base;

use yii\web\HttpException;

class ApiException extends HttpException
{
    public $statusCode = '200';

    /**
     * Constructor.
     *
     * @param string     $message  error message
     * @param int        $code     error code
     * @param \Exception $previous The previous exception used for the exception chaining.
     * @param int        $status   HTTP status code, such as 404, 500, etc.
     */
    public function __construct($message = null, $code = 0, \Exception $previous = null, $status = 200)
    {
        $this->statusCode = '200';//$status;
        parent::__construct($status, $message, $code, $previous);
    }

    public function getName()
    {
        return 'ApiException';
    }

    public $sub_code;
    public $sub_msg;

}